package stubs;

import util.Message;
import dataPO.InfoPO;
import dataPO.POtype;

public class CourseStudentRecordPO_Stub extends InfoPO {

	private static final long serialVersionUID = 1L;

	private String[][] studentID;
	
	public CourseStudentRecordPO_Stub(String[][] studentID) {
		super(POtype.CourseStudentRecordPO);
		this.studentID = studentID;
	}
	
	public CourseStudentRecordPO_Stub(String courseID) {
		super(POtype.CourseStudentRecordPO);
		this.studentID = Data_Stub.getCourseStudentRecord(courseID);
	}

	public String[][] getStudentID() {
		return studentID;
	}
	
	public Message regGrade(String userID, String grade) {
		return null;
	}

	public Message getGrade(String userID) {
		
		for(int i = 0; i < this.studentID.length; i++) {
			if(this.studentID[i][0].equals(userID)) {
				Message temp = new Message("success", this.studentID[i][1]);
				return temp;
			}
		}
		return new Message("fail");
	}
	
}
